// TS对于类型检测的时候使用的是鸭子类型
// 鸭子类型: 只关心属性和行为, 不关心你具体是不是对应的类型

class Person {
  constructor(public name: string, public age: number) {}
  runing() {}
}

class Dog {
  constructor(public name: string, public age: number) {}
  runing() {}
}

function printPerson(p: Person) {
  console.log(p.name, p.age);
}

printPerson(new Person("zs", 12));
printPerson(new Dog("旺财", 23));
const p: Person = new Dog("zs", 21);

export {};
